package com.os.sys.service;


import com.os.sys.mapper.RoleTypeMapper;
import com.os.sys.pojo.RoleType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import util.IdWorker;

import java.util.List;
import java.util.Map;

@Service
@Slf4j
public class RoleTypeService {
    @Autowired
    private RoleTypeMapper roleTypeMapper;
    @Autowired
    private IdWorker idWorker;

    public List<RoleType> selectByPage(Map map){
        return roleTypeMapper.selectByPage(map);
    }

    public RoleType selectById(int id){
        return roleTypeMapper.selectById(id);
    }

    public void insert(RoleType roleType){
        //生成唯一ID
        roleTypeMapper.insert(roleType);
    }
    /**
     * 修改
     * @param roleType
     */
    public void update(RoleType roleType){
        roleTypeMapper.update(roleType);
    }

    public void deleteById(int id){
        roleTypeMapper.deleteById(id);
    }

//    public void deleteAll(){
//        sysUserMapper.deleteAll();
//    }
}

